package com.mer.controller;

import com.mer.sevice.HeadNavService;
import com.mer.vo.CommonResult;
import com.mer.vo.HeadNavVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: HeadNavController
 * @description: 头部导航栏
 * @author: 吴昊
 * @create: 2021/10/19 20:21
 **/
@RestController
@RequestMapping("home/head")
public class HeadNavController {
    @Autowired
    private HeadNavService headNavService;

    @PostMapping("getAllHead/{page}/{limit}")
    public CommonResult getAllHead(@PathVariable Integer page,
                                   @PathVariable Integer limit,
                                   @RequestBody HeadNavVo headNavVo){
           return headNavService.getAllHead(page, limit, headNavVo);
    }
    @PostMapping("delete")
    public CommonResult delete(@RequestBody HeadNavVo headNavVo){
        return headNavService.delete(headNavVo.getHeadId());
    }
    @PostMapping("status/{headId}/{isDiable}")
    public CommonResult status(@PathVariable Integer headId,@PathVariable String isDiable){
        return headNavService.status(headId, isDiable);
    }
        @PostMapping("add")
    public CommonResult add(@RequestBody HeadNavVo headNavVo){
        return headNavService.add(headNavVo);
    }


}
